package com.augurit.gzcgwsp.csdlwj.dao;



import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import com.augurit.common.base.dao.BaseDao;
import com.augurit.gzcgwsp.csdlwj.entity.YwComQyxxCsdlwj;

@Repository
public class YwComQyxxCsdlwjDao extends BaseDao<YwComQyxxCsdlwj, Long> {

	public void updateYwComQyxxCsdlwj(YwComQyxxCsdlwj qyxx) {
		getSession().update(qyxx);
	}

	public YwComQyxxCsdlwj getYwComQyxxCsdlwj(Long id) {
		Session session=getSession();
		Criteria criteria=session.createCriteria(YwComQyxxCsdlwj.class);
		criteria.add(Restrictions.eq("id",id ));
		List list=criteria.list();
		YwComQyxxCsdlwj entity=null;
		if(list!=null && list.size()>0){
			entity=(YwComQyxxCsdlwj) list.get(0);
		}
		
		return entity;
	}
}